---
title: "org-mode图片支持"
date: 2019-3-26
categories:
- emacs
- org-mode
tags:
---

<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orga8f6479">Intro</a></li>
<li><a href="#org3f3984c">快捷键</a>
<ul>
<li><a href="#org9cadffe">切换图片内联显示 C-c C-x C-v (org-toggle-inline-images)</a></li>
</ul>
</li>
<li><a href="#org41cc460">FAQ</a>
<ul>
<li><a href="#org51ca6a8">图片尺寸</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="outline-2" id="outline-container-orga8f6479">
<h2 id="orga8f6479">Intro</h2>
<div class="outline-text-2" id="text-orga8f6479">
<p>
图片就是一个指向图片的，没有描述部分的链接，例如：
</p>
<pre class="example">
[[path/to/image]]
</pre>
<p>
通过下面的方式定义说明：
</p>
<pre class="example">
#+CAPTION: This is the caption for the next figure link (or table)
#+NAME:   fig:SED-HR4049
[[./img/a.jpg]]
</pre>
</div>
</div>
<div class="outline-2" id="outline-container-org3f3984c">
<h2 id="org3f3984c">快捷键</h2>
<div class="outline-text-2" id="text-org3f3984c">
</div>
<div class="outline-3" id="outline-container-org9cadffe">
<h3 id="org9cadffe">切换图片内联显示 C-c C-x C-v (org-toggle-inline-images)</h3>
<div class="outline-text-3" id="text-org9cadffe">
<p>
通过设置 {% raw %} org-startup-with-inline-images {% endraw %} 变量，让这个启动时生效。
</p>
</div>
</div>
</div>
<div class="outline-2" id="outline-container-org41cc460">
<h2 id="org41cc460">FAQ</h2>
<div class="outline-text-2" id="text-org41cc460">
</div>
<div class="outline-3" id="outline-container-org51ca6a8">
<h3 id="org51ca6a8">图片尺寸</h3>
<div class="outline-text-3" id="text-org51ca6a8">
<blockquote>
<p>
<a href="https://stackoverflow.com/questions/11670654/how-to-resize-images-in-org-mode">https://stackoverflow.com/questions/11670654/how-to-resize-images-in-org-mode</a>
</p>
</blockquote>
<ol class="org-ol">
<li>配置 init.el 文件， {% raw %} (setq org-image-actual-width nil) {% endraw %}</li>
<li>在图片上增加属性</li>
</ol>
<pre class="example">
#+ATTR_ORG: :width 100
[[~/images/example.jpg]]
</pre>
<p>
如果希望定义导出的html文件的尺寸，则：
</p>
<pre class="example">
#+ATTR_HTML: width="100px"
#+ATTR_ORG: :width 100
[[~/images/example.jpg]]
</pre>
</div>
</div>
</div>
</div>
<div class="status" id="postamble">
<p class="date">Date: 2019-3-26</p>
<p class="author">Author: gdme1320</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
